package com.collect.zambia.zhiScene.zhiTelemarketing.zhiPerformance.zhiSort;

import com.collect.zambia.zhiBean.zhiReceive.ZHIRTelemarketingPerformanceEntity;
import com.collect.zambia.zhiUtils.ZHICalendarUtil;

import java.util.Comparator;

public class ZHITelemarketingCompareByDateASC implements Comparator<ZHIRTelemarketingPerformanceEntity> {
    @Override
    public int compare(ZHIRTelemarketingPerformanceEntity o1, ZHIRTelemarketingPerformanceEntity o2) {

        long o1DateL = ZHICalendarUtil.getTimeFromDateString(o1.getAssignDate() + " 00:00:00", null);
        long o2DateL = ZHICalendarUtil.getTimeFromDateString(o2.getAssignDate() + " 00:00:00", null);

        if (o1DateL < o2DateL) {
            return -1;
        } else if (o1DateL < o2DateL) {
            return 0;
        } else {
            return 1;
        }
    }
}
